package main

import "fmt"

/**
 * @author: guangcheng
 * @date:   2020/11/3 10:40
 * @version  V1.0
 * @description:
 *
 */
func main() {
	var name string
	var age int
	var sex string

	fmt.Println("please input user name")
	fmt.Scanln(&name)

	fmt.Println("please input user age")
	fmt.Scanln(&age)

	fmt.Println("please input user sex")
	fmt.Scanln(&sex)

	//name:  mandy
	//age:  17
	//sex:  nv
	fmt.Println("\nname: ", name, "\nage: ", age, "\nsex: ", sex)

	fmt.Println("按指定格式输入, 以空格隔开")
	//fmt.Scanf("%s %d %s", &name, &age, &sex)//格式%v %s都行
	fmt.Scanf("%v %v %v", &name, &age, &sex)
	fmt.Println("\nname: ", name, "\nage: ", age, "\nsex: ", sex)

}
